import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import axios from 'axios'
import './assets/css/index.css'
import './assets/css/account.css'
import './assets/css/address-pop.css'
import './assets/css/reset.css'

Vue.use(ElementUI);
Vue.config.productionTip = false

//初始化用户登录状态
let userName=localStorage.getItem('userName');
console.log(userName)
if(userName!=''){
  store.commit('loginMut',{
    bool:true,
    username:userName
  })
}
Vue.config.productionTip = false
let instance =axios.create({
  baseURL:'/'
})


//全局挂载axios方法
let instance1=axios.create({
  baseURL:'http://localhost:3000/'//基本路径
})
Vue.prototype.$http=instance1
Vue.prototype.$axios=instance

new Vue({
  render: h => h(App),
  router ,
  store
}).$mount('#app')
